﻿using UnityEngine;

public class ShakeEffect:MonoBehaviour
{

	public float time = 1f;

	public float amountX = 1f;

	public float amountY = 1f;

	public float amountZ = 1f;
	
	public float delay = 0f;

	public Camera shakeCamera;

	public bool autoShake = true;
	// Use this for initialization
	void OnEnable()
	{
		if (autoShake)
		{
			Shake();
		}
	}

	public void Shake()
	{
		CameraUtil.ShakeScreen(shakeCamera, time, amountX, amountY, amountZ, delay);
	}
}
